package com.ruoyi.web.controller.system;

import com.ruoyi.system.domain.User;
import com.ruoyi.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.List;

@RestController
public class HelloController {
    @Autowired
    private UserService userService;

    @GetMapping("/hello")
    public List<User> hello()
    {
        return userService.selectAllUser();
    }

    @PostMapping("/hello")
    public int insert(@RequestBody User user)
    {return userService.insert(user);}

    @PutMapping("/hello")
    public int update(@RequestBody User user)
    {return userService.update(user);}

    @DeleteMapping("/hello/{id}")
    public Integer delete(@PathVariable("id") int id)
    {return userService.delete(id);}

}
